package come.bjpowernode.javase.fileUtils;

import java.io.File;
import java.io.IOException;

public class FileUtils {
    public  static File creat(String filePath, String fileName){
        //先创建路径
        File dir = new File(filePath);
        if(!dir.exists()){
            dir.mkdirs();
        }

        //后创建文件
        File file = new File(filePath,fileName);
        if(!file.exists()){
            try {
                file.createNewFile();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        return file;
    }
}
